package com.qingluan.web;



import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;

public class Sign_up {
	AsyncHttpClient client  ;
	private RequestParams paramser;
	private String URL =null;
	
	
	public Sign_up (String url){
		this.client = new AsyncHttpClient();
		this.URL = url;
		this.paramser = new RequestParams();
	}
	public void  pushArgument (String key,String value){
		
		this.paramser.put(key, value);
	}
	public void post(final Sign_up_Callback callback,final  FailedCall failed_callback ){
		client.post(URL, this.paramser,new AsyncHttpResponseHandler(){
			@Override
			public void onSuccess(String json){
				callback.callback(json);
			}
			@Override
			public void onFailure(Throwable error,String message){
				failed_callback.callback(message);
			}
		});
	}
	
	public interface Sign_up_Callback {
		public void callback(String msg);
	}
	public interface FailedCall{
		public void callback(String msg);
	}
}
